package com.pic4493.app;

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.pic4493.base.BaseUITopBar;

public class UIWap extends BaseUITopBar
{

   private WebView mWebView;

   @Override
   protected void onCreate(Bundle savedInstanceState)
   {
	  setContentView(R.layout.uiwap);
	  super.onCreate(savedInstanceState);
	  setTitle("手机站");

	  mWebView = (WebView) findViewById(R.id.uiwap_webview);
	  mWebView.getSettings().setJavaScriptEnabled(true);
	  mWebView.getSettings().setBuiltInZoomControls(true);
	  mWebView.getSettings().setDefaultTextEncodingName("utf-8");
	  mWebView.setWebViewClient(new MyWebViewClient());
	  mWebView.loadUrl(getResources().getString(R.string.url_wap));
   }

   @Override
   public void onBackPressed()
   {
	  if (mWebView.canGoBack())
	  {
		 mWebView.goBack();
	  }
	  else
	  {
		 finish();
	  }
   }

   private class MyWebViewClient extends WebViewClient
   {
	  @Override
	  public boolean shouldOverrideUrlLoading(WebView view, String url)
	  {
		 return super.shouldOverrideUrlLoading(view, url);
	  }
   }

}
